home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS075.dsk
/
HEXCON.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
1KB
|
31 lines
10 TEXT : HOME :A$ = "HEXCON":L = LEN(A$): PRINT TAB( (40 -L)/2);A$: PRINT TAB( (40 -L)/2);: FOR I = 1 TO L: PRINT "^";: NEXT : PRINT
20 PRINT " INPUT"; TAB( 11);"$HEX"; TAB( 21);"POS"; TAB( 31);"<"; CHR$(92);"32768"; CHR$(92)
30 VTAB 24: PRINT "**PRESS 'RETURN' WHEN FINISHED**";: POKE 35,23: POKE 34,4: VTAB 4: PRINT
50 INPUT Z$: IF Z$ = "" THEN TEXT : END
60 L = LEN(Z$) -1: IF L >5 THEN GOSUB 800: GOTO 50
70 IF ASC(Z$) = 36 GOTO 400
200 M = INT( VAL(Z$)):K = M:G$ = ""
210 IF K <0 THEN K = M +65536
220 IF K <0 THEN GOSUB 800: GOTO 50
230 I = INT(K)
240 J% = I/16 +.01:K% = I -16 *J%:K$ = STR$(K%)
250 IF K% >9 THEN K$ = CHR$(K% +55)
260 G$ = K$ +G$
270 IF J% = 0 THEN H$ = "$" +G$: GOTO 470
280 I = J%: GOTO 240
400 J = 0:K = 0:H$ = Z$:G$ = RIGHT$(Z$,L)
410 FOR I = 1 TO L:K = 16 *(K +J):K$ = MID$ (G$,I,1):J = ASC(K$)
420 IF J >70 OR J <48 THEN GOSUB 800: GOTO 50
430 IF J >64 THEN J = J -55: GOTO 460
440 IF J >57 THEN GOSUB 800: GOTO 50
450 J = J -48
460 NEXT :K = K +J:M = K
470 IF M >32767 THEN M = K -65536
700 GOSUB 800
710 PRINT " ";Z$; TAB( 11);H$; TAB( 21);K; TAB( 31);M: GOTO 50
800 CV = PEEK(37): VTAB CV: RETURN
810 :
65532 REM BY DAVE EDMUNDS, 1 JUL 80
65533 REM
65534 REM HEXCON
65535 REM